// Copyright (c) 2023 坚果派
// 公众号：nutpi
// 电话：17752170152
// 官网：https://www.nutpi.net/
// All rights reserved.

import 'package:flutter/material.dart';

class HealthDesktopWidget extends StatelessWidget {
  final String tipContent;
  final VoidCallback onRefresh;

  const HealthDesktopWidget({
    super.key,
    required this.tipContent,
    required this.onRefresh,
  });

  @override
  Widget build(BuildContext context) {
    // 桌面小部件的UI设计
    return Container(
      padding: const EdgeInsets.all(16),
      decoration: BoxDecoration(
        color: Colors.green[100],
        borderRadius: BorderRadius.circular(16),
        boxShadow: [
          BoxShadow(
            color: Colors.black.withOpacity(0.1),
            blurRadius: 10,
            offset: const Offset(0, 4),
          ),
        ],
      ),
      child: Column(
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Row(
            children: [
              const Icon(Icons.health_and_safety, color: Colors.green),
              const SizedBox(width: 8),
              const Text(
                '每日健康提示',
                style: TextStyle(
                  fontWeight: FontWeight.bold,
                  fontSize: 16,
                ),
              ),
              const Spacer(),
              IconButton(
                icon: const Icon(Icons.refresh, size: 20),
                onPressed: onRefresh,
                color: Colors.green,
              ),
            ],
          ),
          const Divider(),
          Expanded(
            child: Center(
              child: Text(
                tipContent,
                style: const TextStyle(fontSize: 18),
                textAlign: TextAlign.center,
              ),
            ),
          ),
        ],
      ),
    );
  }
}
